﻿using System.Windows.Data;
using System.Windows.Media;

namespace XYAC.Framework.MonitorTireMaterialManual.Converters
{
    public class BoolToColorConverter : IValueConverter
    {
        public Brush TrueValue { get; set; } = Brushes.Green;
        public Brush FalseValue { get; set; } = Brushes.Red;
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            try
            {
                return (bool)value ? TrueValue : FalseValue;
            }
            catch (Exception)
            {
                return Brushes.Black;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
